namespace Domotica.Windows.Input
{
    using System;
    using System.ComponentModel;
    using System.Windows.Input;
    using System.Windows.Markup;

    [TypeConverter(typeof(SpeechGestureConverter)), ValueSerializer(typeof(SpeechGestureValueSerializer))]
    public class SpeechGesture : InputGesture
    {
        private string _ChoiceText;

        public SpeechGesture()
        {
        }

        public SpeechGesture(string choiceText)
        {
            this._ChoiceText = choiceText;
        }

        public override bool Matches(object targetElement, InputEventArgs inputEventArgs)
        {
            if (inputEventArgs is SpeechEventArgs)
            {
                SpeechEventArgs sea = (SpeechEventArgs) inputEventArgs;
                return (string.Compare(this.ChoiceText, sea.ChoiceText, true) == 0);
            }
            return false;
        }

        public string ChoiceText
        {
            get
            {
                return this._ChoiceText;
            }
            set
            {
                this._ChoiceText = value;
            }
        }
    }
}

